ddns-script: Change CURL call and redirect output in update_porkbun_v3
authorRikki Vizcarra <[email protected]>
Mon, 24 Mar 2025 21:41:25 +0000 (05:41 +0800)
committerFlorian Eckert <[email protected]>
Sun, 20 Apr 2025 20:10:44 +0000 (22:10 +0200)
This also fixes: https://github.com/openwrt/packages/issues/26181

CURL funciton change was patterned on other ddns update scripts
that uses also JSON request/response payloads similar to
update_digitalocean_v2.sh: https://github.com/openwrt/packages/blob/15014f93e15bcb29956bf79cd397fea580bf6ea6/net/ddns-scripts/files/usr/lib/ddns/update_digitalocean_com_v2.sh#L29
update_gcp_v1.sh: https://github.com/openwrt/packages/blob/15014f93e15bcb29956bf79cd397fea580bf6ea6/net/ddns-scripts/files/usr/lib/ddns/update_gcp_v1.sh#L212

rebased and bumbped ddns-script version

Signed-off-by: Rikki Vizcarra <[email protected]>
net/ddns-scripts/Makefile
net/ddns-scripts/files/usr/lib/ddns/update_porkbun_v3.sh

index 5cd08eab8186b4cd4fceb8750bb94560e5a149de..ab9382fb17b8ed08604850f48a835c38e7a2d28b 100644 (file)
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ddns-scripts
 PKG_VERSION:=2.8.2
-PKG_RELEASE:=69
+PKG_RELEASE:=70
 
 PKG_LICENSE:=GPL-2.0
 
index 3e8bdac135f2e3371cfaa81915f4e8435d76df89..658fb1ff694a837f6579d7f31aeaa304eeffa467 100644 (file)
@@ -59,9 +59,9 @@ function api_call() {
        url="$__API/$1"
        write_log 7 "API endpoint URL: $url"
        write_log 7 "API request JSON payload: $2"
-       response=$($CURL --data "$2" "$url")
-       write_log 7 "API response JSON payload: $response"
-       echo "$response"
+       response="$("$CURL" -s -X POST "$url" -H "Content-Type: application/json" --data "$2" -o "$DATFILE" 2>"$ERRFILE")"
+       write_log 7 "API response JSON payload: $(cat "$DATFILE")"
+       echo "$(cat "$DATFILE")"
 }
 
 # Check Porkbun API response status